package com.bmw.redis1.controller;

import com.bmw.redis1.base.BaseResponse;
import com.bmw.redis1.base.ClickRequest;
import com.bmw.redis1.service.NewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * Classname: newsController
 * Package: com.bmw.redis1.controller
 * Description:
 *
 * @Author 王少伟
 * @Create 2024/5/22 18:22
 * @Version 1.8
 */
@RestController
@RequestMapping("/news")
public class newsController {
    @Autowired
    NewsService newsService;

    @RequestMapping("/click")
    public BaseResponse clickNews(@RequestBody @Valid ClickRequest req){
        return BaseResponse.OK(newsService.renew(req));
    }
}
